home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / Drtf / rtf.h < prev    next >
Text File  |  1996-07-05  |  36KB  |  1,144 lines

  1. /*
  2.  * rtf.h - RTF document processing stuff.  Release 1.10.
  3.  */
  4. /* dgg added _RTF_ and __cplusplus flag */
  5.  
  6. #ifndef _RTF_
  7. #define _RTF_
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. /*
  14.  * Twentieths of a point (twips) per inch (Many RTF measurements
  15.  * are in twips per inch (tpi) units).  Assumes 72 points/inch.
  16.  */
  17.  
  18. # define    rtfTpi        1440
  19.  
  20. /*
  21.  * RTF buffer size (avoids BUFSIZ, which differs across systems)
  22.  */
  23.  
  24. # define    rtfBufSiz    1024
  25.  
  26. /*
  27.  * Tokens are associated with up to three classification numbers:
  28.  *
  29.  * Class number: Broadest (least detailed) breakdown.  For programs
  30.  *     that only care about gross token distinctions.
  31.  * Major/minor numbers: Within their class, tokens have a major
  32.  *     number, and may also have a minor number to further
  33.  *     distinquish tokens with the same major number.
  34.  *
  35.  *    *** Class, major and minor token numbers are all >= 0 ***
  36.  *
  37.  * Tokens that can't be classified are put in the "unknown" class.
  38.  * For such, the major and minor numbers are meaningless, although
  39.  * rtfTextBuf may be of interest then.
  40.  *
  41.  * Text tokens are a single character, and the major number indicates
  42.  * the character value (note: can be non-ascii, i.e., greater than 127).
  43.  * There is no minor number.
  44.  *
  45.  * Control symbols may have a parameter value, which will be found in
  46.  * rtfParam.  If no parameter was given, rtfParam = rtfNoParam.
  47.  *
  48.  * RTFGetToken() return value is the class number, but it sets all the
  49.  * global token vars.
  50.  *
  51.  * rtfEOF is a fake token used by the reader; the writer never sees
  52.  * it (except in the token reader hook, if it installs one).
  53.  */
  54.  
  55.  
  56. /*
  57.  * Information pertaining to last token read by RTFToken.  The
  58.  * text is exactly as it occurs in the input file, e.g., "\{"
  59.  * will be found in rtfTextBuf as "\{", even though it means "{".
  60.  * These variables are also set when styles are reprocessed.
  61.  */
  62.  
  63. extern char    *rtfTextBuf;        /* text of token */
  64. extern short    rtfTextLen;        /* length of token in rtfTextBuf */
  65. extern short    rtfClass;        /* token class */
  66. extern short    rtfMajor;        /* token major number */
  67. extern short    rtfMinor;        /* token minor number */
  68. extern short    rtfParam;        /* control symbol parameter */
  69.  
  70. # ifdef THINK_C
  71. # define    rtfNoParam    (-32768)    /* 16-bit max. neg. value */
  72. # endif
  73. # ifndef rtfNoParam
  74. # define    rtfNoParam    (-1000000)
  75. # endif
  76.  
  77. extern long    rtfLineNum;        /* input line number */
  78. extern short    rtfLinePos;        /* input line position */
  79.  
  80. /*
  81.  * For some reason, the no-style number is 222
  82.  */
  83.  
  84. # define    rtfNoStyleNum        222
  85. # define    rtfNormalStyleNum    0
  86.  
  87.  
  88. /*
  89.  * Token classes (must be zero-based and sequential)
  90.  */
  91.  
  92. # define    rtfUnknown    0
  93. # define    rtfGroup    1
  94. # define    rtfText        2
  95. # define    rtfControl    3
  96. # define    rtfEOF        4
  97. # define    rtfMaxClass    5    /* highest class + 1 */
  98.  
  99. /*
  100.  * Group class major numbers
  101.  */
  102.  
  103. # define    rtfBeginGroup    0
  104. # define    rtfEndGroup    1
  105.  
  106. /*
  107.  * Control class major and minor numbers.
  108.  */
  109.  
  110. # define    rtfVersion    0
  111.  
  112. # define    rtfDefFont    1
  113.  
  114. # define    rtfCharSet    2
  115. # define        rtfAnsiCharSet        0
  116. # define        rtfMacCharSet        1
  117. # define        rtfPcCharSet        2
  118. # define        rtfPcaCharSet        3
  119.  
  120.  
  121. /* destination minor numbers should be zero-based and sequential */
  122.  
  123. # define    rtfDestination    3
  124. # define        rtfFontTbl        0
  125. # define        rtfFontAltName        1    /* new in 1.10 */
  126. # define        rtfEmbeddedFont        2    /* new in 1.10 */
  127. # define        rtfFontFile        3    /* new in 1.10 */
  128. # define        rtfFileTbl        4    /* new in 1.10 */
  129. # define        rtfFileInfo        5    /* new in 1.10 */
  130. # define        rtfColorTbl        6
  131. # define        rtfStyleSheet        7
  132. # define        rtfKeyCode        8
  133. # define        rtfRevisionTbl        9    /* new in 1.10 */
  134. # define        rtfInfo            10
  135. # define        rtfITitle        11
  136. # define        rtfISubject        12
  137. # define        rtfIAuthor        13
  138. # define        rtfIOperator        14
  139. # define        rtfIKeywords        15
  140. # define        rtfIComment        16
  141. # define        rtfIVersion        17
  142. # define        rtfIDoccomm        18
  143. # define        rtfIVerscomm        19
  144. # define        rtfNextFile        20    /* reclassified in 1.10 */
  145. # define        rtfTemplate        21    /* reclassified in 1.10 */
  146. # define        rtfFNSep        22
  147. # define        rtfFNContSep        23
  148. # define        rtfFNContNotice        24
  149. # define        rtfENSep        25    /* new in 1.10 */
  150. # define        rtfENContSep        26    /* new in 1.10 */
  151. # define        rtfENContNotice        27    /* new in 1.10 */
  152. # define        rtfPageNumLevel        28    /* new in 1.10 */
  153. # define        rtfParNumLevelStyle    29    /* new in 1.10 */
  154. # define        rtfHeader        30
  155. # define        rtfFooter        31
  156. # define        rtfHeaderLeft        32
  157. # define        rtfHeaderRight        33
  158. # define        rtfHeaderFirst        34
  159. # define        rtfFooterLeft        35
  160. # define        rtfFooterRight        36
  161. # define        rtfFooterFirst        37
  162. # define        rtfParNumText        38    /* new in 1.10 */
  163. # define        rtfParNumbering        39    /* new in 1.10 */
  164. # define        rtfParNumTextAfter    40    /* new in 1.10 */
  165. # define        rtfParNumTextBefore    41    /* new in 1.10 */
  166. # define        rtfBookmarkStart    42
  167. # define        rtfBookmarkEnd        43
  168. # define        rtfPict            44
  169. # define        rtfObject        45
  170. # define        rtfObjClass        46
  171. # define        rtfObjName        47
  172. # define        rtfObjTime        48    /* new in 1.10 */
  173. # define        rtfObjData        49
  174. # define        rtfObjAlias        50
  175. # define        rtfObjSection        51
  176. # define        rtfObjResult        52
  177. # define        rtfObjItem        53    /* new in 1.10 */
  178. # define        rtfObjTopic        54    /* new in 1.10 */
  179. # define        rtfDrawObject        55    /* new in 1.10 */
  180. # define        rtfFootnote        56
  181. # define        rtfAnnotRefStart    57    /* new in 1.10 */
  182. # define        rtfAnnotRefEnd        58    /* new in 1.10 */
  183. # define        rtfAnnotID        59    /* reclassified in 1.10 */
  184. # define        rtfAnnotAuthor        60    /* new in 1.10 */
  185. # define        rtfAnnotation        61    /* reclassified in 1.10 */
  186. # define        rtfAnnotRef        62    /* new in 1.10 */
  187. # define        rtfAnnotTime        63    /* new in 1.10 */
  188. # define        rtfAnnotIcon        64    /* new in 1.10 */
  189. # define        rtfField        65
  190. # define        rtfFieldInst        66
  191. # define        rtfFieldResult        67
  192. # define        rtfDataField        68    /* new in 1.10 */
  193. # define        rtfIndex        69
  194. # define        rtfIndexText        70
  195. # define        rtfIndexRange        71
  196. # define        rtfTOC            72
  197. # define        rtfNeXTGraphic        73
  198. # define        rtfMaxDestination    74    /* highest dest + 1 */
  199.  
  200. # define    rtfFontFamily    4
  201. # define        rtfFFNil        0
  202. # define        rtfFFRoman        1
  203. # define        rtfFFSwiss        2
  204. # define        rtfFFModern        3
  205. # define        rtfFFScript        4
  206. # define        rtfFFDecor        5
  207. # define        rtfFFTech        6
  208. # define        rtfFFBidirectional    7    /* new in 1.10 */
  209.  
  210. # define    rtfColorName    5
  211. # define        rtfRed            0
  212. # define        rtfGreen        1
  213. # define        rtfBlue            2
  214.  
  215. # define    rtfSpecialChar    6
  216.     /* special chars seen in \info destination */
  217. # define        rtfIIntVersion        0
  218. # define        rtfICreateTime        1
  219. # define        rtfIRevisionTime    2
  220. # define        rtfIPrintTime        3
  221. # define        rtfIBackupTime        4
  222. # define        rtfIEditTime        5
  223. # define        rtfIYear        6
  224. # define        rtfIMonth        7
  225. # define        rtfIDay            8
  226. # define        rtfIHour        9
  227. # define        rtfIMinute        10
  228. # define        rtfISecond        11    /* new in 1.10 */
  229. # define        rtfINPages        12
  230. # define        rtfINWords        13
  231. # define        rtfINChars        14
  232. # define        rtfIIntID        15
  233.     /* other special chars */
  234. # define        rtfCurHeadDate        16
  235. # define        rtfCurHeadDateLong    17
  236. # define        rtfCurHeadDateAbbrev    18
  237. # define        rtfCurHeadTime        19
  238. # define        rtfCurHeadPage        20
  239. # define        rtfSectNum        21    /* new in 1.10 */
  240. # define        rtfCurFNote        22
  241. # define        rtfCurAnnotRef        23
  242. # define        rtfFNoteSep        24
  243. # define        rtfFNoteCont        25
  244. # define        rtfCell            26
  245. # define        rtfRow            27
  246. # define        rtfPar            28
  247. # define        rtfSect            29
  248. # define        rtfPage            30
  249. # define        rtfColumn        31
  250. # define        rtfLine            32
  251. # define        rtfSoftPage        33    /* new in 1.10 */
  252. # define        rtfSoftColumn        34    /* new in 1.10 */
  253. # define        rtfSoftLine        35    /* new in 1.10 */
  254. # define        rtfSoftLineHt        36    /* new in 1.10 */
  255. # define        rtfTab            37
  256. # define        rtfEmDash        38
  257. # define        rtfEnDash        39
  258. # define        rtfEmSpace        40    /* new in 1.10 */
  259. # define        rtfEnSpace        41    /* new in 1.10 */
  260. # define        rtfBullet        42
  261. # define        rtfLQuote        43
  262. # define        rtfRQuote        44
  263. # define        rtfLDblQuote        45
  264. # define        rtfRDblQuote        46
  265. # define        rtfFormula        47
  266. # define        rtfNoBrkSpace        49
  267. # define        rtfNoReqHyphen        50
  268. # define        rtfNoBrkHyphen        51
  269. # define        rtfOptDest        52
  270. # define        rtfLTRMark        53    /* new in 1.10 */
  271. # define        rtfRTLMark        54    /* new in 1.10 */
  272. # define        rtfNoWidthJoiner    55    /* new in 1.10 */
  273. # define        rtfNoWidthNonJoiner    56    /* new in 1.10 */
  274. # define        rtfCurHeadPict        57    /* valid? */
  275. /*# define        rtfCurAnnot        58*/    /* apparently not used */
  276.  
  277. # define    rtfStyleAttr    7
  278. # define        rtfAdditive        0    /* new in 1.10 */
  279. # define        rtfBasedOn        1
  280. # define        rtfNext            2
  281.  
  282. # define    rtfDocAttr    8
  283. # define        rtfDefTab        0
  284. # define        rtfHyphHotZone        1
  285. # define        rtfHyphConsecLines    2    /* new in 1.10 */
  286. # define        rtfHyphCaps        3    /* new in 1.10 */
  287. # define        rtfHyphAuto        4    /* new in 1.10 */
  288. # define        rtfLineStart        5
  289. # define        rtfFracWidth        6
  290. # define        rtfMakeBackup        7
  291. # define        rtfRTFDefault        8
  292. # define        rtfPSOverlay        9
  293. # define        rtfDocTemplate        10    /* new in 1.10 */
  294. # define        rtfDefLanguage        11
  295. # define        rtfFENoteType        12    /* new in 1.10 */
  296. # define        rtfFNoteEndSect        13
  297. # define        rtfFNoteEndDoc        14
  298. # define        rtfFNoteText        15
  299. # define        rtfFNoteBottom        16
  300. # define        rtfENoteEndSect        17    /* new in 1.10 */
  301. # define        rtfENoteEndDoc        18    /* new in 1.10 */
  302. # define        rtfENoteText        19    /* new in 1.10 */
  303. # define        rtfENoteBottom        20    /* new in 1.10 */
  304. # define        rtfFNoteStart        21
  305. # define        rtfENoteStart        22    /* new in 1.10 */
  306. # define        rtfFNoteRestartPage    23    /* new in 1.10 */
  307. # define        rtfFNoteRestart        24
  308. # define        rtfFNoteRestartCont    25    /* new in 1.10 */
  309. # define        rtfENoteRestart        26    /* new in 1.10 */
  310. # define        rtfENoteRestartCont    27    /* new in 1.10 */
  311. # define        rtfFNoteNumArabic    28    /* new in 1.10 */
  312. # define        rtfFNoteNumLLetter    29    /* new in 1.10 */
  313. # define        rtfFNoteNumULetter    30    /* new in 1.10 */
  314. # define        rtfFNoteNumLRoman    31    /* new in 1.10 */
  315. # define        rtfFNoteNumURoman    32    /* new in 1.10 */
  316. # define        rtfFNoteNumChicago    33    /* new in 1.10 */
  317. # define        rtfENoteNumArabic    34    /* new in 1.10 */
  318. # define        rtfENoteNumLLetter    35    /* new in 1.10 */
  319. # define        rtfENoteNumULetter    36    /* new in 1.10 */
  320. # define        rtfENoteNumLRoman    37    /* new in 1.10 */
  321. # define        rtfENoteNumURoman    38    /* new in 1.10 */
  322. # define        rtfENoteNumChicago    39    /* new in 1.10 */
  323. # define        rtfPaperWidth        40
  324. # define        rtfPaperHeight        41
  325. # define        rtfPaperSize        42    /* new in 1.10 */
  326. # define        rtfLeftMargin        43
  327. # define        rtfRightMargin        44
  328. # define        rtfTopMargin        45
  329. # define        rtfBottomMargin        46
  330. # define        rtfFacingPage        47
  331. # define        rtfGutterWid        48
  332. # define        rtfMirrorMargin        49
  333. # define        rtfLandscape        50
  334. # define        rtfPageStart        51
  335. # define        rtfWidowCtrl        52
  336. # define        rtfLinkStyles        53    /* new in 1.10 */
  337. # define        rtfNoAutoTabIndent    54    /* new in 1.10 */
  338. # define        rtfWrapSpaces        55    /* new in 1.10 */
  339. # define        rtfPrintColorsBlack    56    /* new in 1.10 */
  340. # define        rtfNoExtraSpaceRL    57    /* new in 1.10 */
  341. # define        rtfNoColumnBalance    58    /* new in 1.10 */
  342. # define        rtfCvtMailMergeQuote    59    /* new in 1.10 */
  343. # define        rtfSuppressTopSpace    60    /* new in 1.10 */
  344. # define        rtfSuppressPreParSpace    61    /* new in 1.10 */
  345. # define        rtfCombineTblBorders    62    /* new in 1.10 */
  346. # define        rtfTranspMetafiles    63    /* new in 1.10 */
  347. # define        rtfSwapBorders        64    /* new in 1.10 */
  348. # define        rtfShowHardBreaks    65    /* new in 1.10 */
  349. # define        rtfFormProtected    66    /* new in 1.10 */
  350. # define        rtfAllProtected        67    /* new in 1.10 */
  351. # define        rtfFormShading        68    /* new in 1.10 */
  352. # define        rtfFormDisplay        69    /* new in 1.10 */
  353. # define        rtfPrintData        70    /* new in 1.10 */
  354. # define        rtfRevProtected        71    /* new in 1.10 */
  355. # define        rtfRevisions        72
  356. # define        rtfRevDisplay        73
  357. # define        rtfRevBar        74
  358. # define        rtfAnnotProtected    75    /* new in 1.10 */
  359. # define        rtfRTLDoc        76    /* new in 1.10 */
  360. # define        rtfLTRDoc        77    /* new in 1.10 */
  361.  
  362. # define    rtfSectAttr    9
  363. # define        rtfSectDef        0
  364. # define        rtfENoteHere        1
  365. # define        rtfPrtBinFirst        2
  366. # define        rtfPrtBin        3
  367. # define        rtfSectStyleNum        4    /* new in 1.10 */
  368. # define        rtfNoBreak        5
  369. # define        rtfColBreak        6
  370. # define        rtfPageBreak        7
  371. # define        rtfEvenBreak        8
  372. # define        rtfOddBreak        9
  373. # define        rtfColumns        10
  374. # define        rtfColumnSpace        11
  375. # define        rtfColumnNumber        12    /* new in 1.10 */
  376. # define        rtfColumnSpRight    13    /* new in 1.10 */
  377. # define        rtfColumnWidth        14    /* new in 1.10 */
  378. # define        rtfColumnLine        15
  379. # define        rtfLineModulus        16
  380. # define        rtfLineDist        17
  381. # define        rtfLineStarts        18
  382. # define        rtfLineRestart        19
  383. # define        rtfLineRestartPg    20
  384. # define        rtfLineCont        21
  385. # define        rtfSectPageWid        22
  386. # define        rtfSectPageHt        23
  387. # define        rtfSectMarginLeft    24
  388. # define        rtfSectMarginRight    25
  389. # define        rtfSectMarginTop    26
  390. # define        rtfSectMarginBottom    27
  391. # define        rtfSectMarginGutter    28
  392. # define        rtfSectLandscape    29
  393. # define        rtfTitleSpecial        30
  394. # define        rtfHeaderY        31
  395. # define        rtfFooterY        32
  396. # define        rtfPageStarts        33
  397. # define        rtfPageCont        34
  398. # define        rtfPageRestart        35
  399. # define        rtfPageNumRight        36    /* renamed in 1.10 */
  400. # define        rtfPageNumTop        37
  401. # define        rtfPageDecimal        38
  402. # define        rtfPageURoman        39
  403. # define        rtfPageLRoman        40
  404. # define        rtfPageULetter        41
  405. # define        rtfPageLLetter        42
  406. # define        rtfPageNumHyphSep    43    /* new in 1.10 */
  407. # define        rtfPageNumSpaceSep    44    /* new in 1.10 */
  408. # define        rtfPageNumColonSep    45    /* new in 1.10 */
  409. # define        rtfPageNumEmdashSep    46    /* new in 1.10 */
  410. # define        rtfPageNumEndashSep    47    /* new in 1.10 */
  411. # define        rtfTopVAlign        48
  412. # define        rtfBottomVAlign        49
  413. # define        rtfCenterVAlign        50
  414. # define        rtfJustVAlign        51
  415. # define        rtfRTLSect        52    /* new in 1.10 */
  416. # define        rtfLTRSect        53    /* new in 1.10 */
  417.  
  418. # define    rtfTblAttr    10
  419. # define        rtfRowDef        0
  420. # define        rtfRowGapH        1
  421. # define        rtfCellPos        2
  422. # define        rtfMergeRngFirst    3
  423. # define        rtfMergePrevious    4
  424. # define        rtfRowLeft        5
  425. # define        rtfRowRight        6
  426. # define        rtfRowCenter        7
  427. # define        rtfRowLeftEdge        8
  428. # define        rtfRowHt        9
  429. # define        rtfRowHeader        10    /* new in 1.10 */
  430. # define        rtfRowKeep        11    /* new in 1.10 */
  431. # define        rtfRTLRow        12    /* new in 1.10 */
  432. # define        rtfLTRRow        13    /* new in 1.10 */
  433. # define        rtfRowBordTop        14    /* new in 1.10 */
  434. # define        rtfRowBordLeft        15    /* new in 1.10 */
  435. # define        rtfRowBordBottom    16    /* new in 1.10 */
  436. # define        rtfRowBordRight        17    /* new in 1.10 */
  437. # define        rtfRowBordHoriz        18    /* new in 1.10 */
  438. # define        rtfRowBordVert        19    /* new in 1.10 */
  439. # define        rtfCellBordBottom    20
  440. # define        rtfCellBordTop        21
  441. # define        rtfCellBordLeft        22
  442. # define        rtfCellBordRight    23
  443. # define        rtfCellShading        24
  444. # define        rtfCellBgPatH        25
  445. # define        rtfCellBgPatV        26
  446. # define        rtfCellFwdDiagBgPat    27
  447. # define        rtfCellBwdDiagBgPat    28
  448. # define        rtfCellHatchBgPat    29
  449. # define        rtfCellDiagHatchBgPat    30
  450. # define        rtfCellDarkBgPatH    31
  451. # define        rtfCellDarkBgPatV    32
  452. # define        rtfCellFwdDarkBgPat    33
  453. # define        rtfCellBwdDarkBgPat    34
  454. # define        rtfCellDarkHatchBgPat    35
  455. # define        rtfCellDarkDiagHatchBgPat 36
  456. # define        rtfCellBgPatLineColor    37
  457. # define        rtfCellBgPatColor    38
  458.  
  459. # define    rtfParAttr    11
  460. # define        rtfParDef        0
  461. # define        rtfStyleNum        1
  462. # define        rtfHyphenate        2    /* new in 1.10 */
  463. # define        rtfInTable        3
  464. # define        rtfKeep            4
  465. # define        rtfNoWidowControl    5    /* new in 1.10 */
  466. # define        rtfKeepNext        6
  467. # define        rtfOutlineLevel        7    /* new in 1.10 */
  468. # define        rtfNoLineNum        8
  469. # define        rtfPBBefore        9
  470. # define        rtfSideBySide        10
  471. # define        rtfQuadLeft        11
  472. # define        rtfQuadRight        12
  473. # define        rtfQuadJust        13
  474. # define        rtfQuadCenter        14
  475. # define        rtfFirstIndent        15
  476. # define        rtfLeftIndent        16
  477. # define        rtfRightIndent        17
  478. # define        rtfSpaceBefore        18
  479. # define        rtfSpaceAfter        19
  480. # define        rtfSpaceBetween        20
  481. # define        rtfSpaceMultiply    21    /* new in 1.10 */
  482. # define        rtfSubDocument        22    /* new in 1.10 */
  483. # define        rtfRTLPar        23    /* new in 1.10 */
  484. # define        rtfLTRPar        24    /* new in 1.10 */
  485. # define        rtfTabPos        25
  486. # define        rtfTabLeft        26    /* new in 1.10 */
  487. # define        rtfTabRight        27
  488. # define        rtfTabCenter        28
  489. # define        rtfTabDecimal        29
  490. # define        rtfTabBar        30
  491. # define        rtfLeaderDot        31
  492. # define        rtfLeaderHyphen        32
  493. # define        rtfLeaderUnder        33
  494. # define        rtfLeaderThick        34
  495. # define        rtfLeaderEqual        35
  496. # define        rtfParLevel        36    /* new in 1.10 */
  497. # define        rtfParBullet        37    /* new in 1.10 */
  498. # define        rtfParSimple        38    /* new in 1.10 */
  499. # define        rtfParNumCont        39    /* new in 1.10 */
  500. # define        rtfParNumOnce        40    /* new in 1.10 */
  501. # define        rtfParNumAcross        41    /* new in 1.10 */
  502. # define        rtfParHangIndent    42    /* new in 1.10 */
  503. # define        rtfParNumRestart    43    /* new in 1.10 */
  504. # define        rtfParNumCardinal    44    /* new in 1.10 */
  505. # define        rtfParNumDecimal    45    /* new in 1.10 */
  506. # define        rtfParNumULetter    46    /* new in 1.10 */
  507. # define        rtfParNumURoman        47    /* new in 1.10 */
  508. # define        rtfParNumLLetter    48    /* new in 1.10 */
  509. # define        rtfParNumLRoman        49    /* new in 1.10 */
  510. # define        rtfParNumOrdinal    50    /* new in 1.10 */
  511. # define        rtfParNumOrdinalText    51    /* new in 1.10 */
  512. # define        rtfParNumBold        52    /* new in 1.10 */
  513. # define        rtfParNumItalic        53    /* new in 1.10 */
  514. # define        rtfParNumAllCaps    54    /* new in 1.10 */
  515. # define        rtfParNumSmallCaps    55    /* new in 1.10 */
  516. # define        rtfParNumUnder        56    /* new in 1.10 */
  517. # define        rtfParNumDotUnder    57    /* new in 1.10 */
  518. # define        rtfParNumDbUnder    58    /* new in 1.10 */
  519. # define        rtfParNumNoUnder    59    /* new in 1.10 */
  520. # define        rtfParNumWordUnder    60    /* new in 1.10 */
  521. # define        rtfParNumStrikethru    61    /* new in 1.10 */
  522. # define        rtfParNumForeColor    62    /* new in 1.10 */
  523. # define        rtfParNumFont        63    /* new in 1.10 */
  524. # define        rtfParNumFontSize    64    /* new in 1.10 */
  525. # define        rtfParNumIndent        65    /* new in 1.10 */
  526. # define        rtfParNumSpacing    66    /* new in 1.10 */
  527. # define        rtfParNumInclPrev    67    /* new in 1.10 */
  528. # define        rtfParNumCenter        68    /* new in 1.10 */
  529. # define        rtfParNumLeft        69    /* new in 1.10 */
  530. # define        rtfParNumRight        70    /* new in 1.10 */
  531. # define        rtfParNumStartAt    71    /* new in 1.10 */
  532. # define        rtfBorderTop        72
  533. # define        rtfBorderBottom        73
  534. # define        rtfBorderLeft        74
  535. # define        rtfBorderRight        75
  536. # define        rtfBorderBetween    76
  537. # define        rtfBorderBar        77
  538. # define        rtfBorderBox        78
  539. # define        rtfBorderSingle        79
  540. # define        rtfBorderThick        80
  541. # define        rtfBorderShadow        81
  542. # define        rtfBorderDouble        82
  543. # define        rtfBorderDot        83
  544. # define        rtfBorderDash        84    /* new in 1.10 */
  545. # define        rtfBorderHair        85
  546. # define        rtfBorderWidth        86
  547. # define        rtfBorderColor        87
  548. # define        rtfBorderSpace        88
  549. # define        rtfShading        89
  550. # define        rtfBgPatH        90
  551. # define        rtfBgPatV        91
  552. # define        rtfFwdDiagBgPat        92
  553. # define        rtfBwdDiagBgPat        93
  554. # define        rtfHatchBgPat        94
  555. # define        rtfDiagHatchBgPat    95
  556. # define        rtfDarkBgPatH        96
  557. # define        rtfDarkBgPatV        97
  558. # define        rtfFwdDarkBgPat        98
  559. # define        rtfBwdDarkBgPat        99
  560. # define        rtfDarkHatchBgPat    100
  561. # define        rtfDarkDiagHatchBgPat    101
  562. # define        rtfBgPatLineColor    102
  563. # define        rtfBgPatColor        103
  564.  
  565. # define    rtfCharAttr    12
  566. # define        rtfPlain        0
  567. # define        rtfBold            1
  568. # define        rtfAllCaps        2
  569. # define        rtfDeleted        3
  570. # define        rtfSubScript        4
  571. # define        rtfSubScrShrink        5    /* new in 1.10 */
  572. # define        rtfNoSuperSub        6    /* new in 1.10 */
  573. # define        rtfExpand        7
  574. # define        rtfExpandTwips        8    /* new in 1.10 */
  575. # define        rtfKerning        9    /* new in 1.10 */
  576. # define        rtfFontNum        10
  577. # define        rtfFontSize        11
  578. # define        rtfItalic        12
  579. # define        rtfOutline        13
  580. # define        rtfRevised        14
  581. # define        rtfRevAuthor        15    /* new in 1.10 */
  582. # define        rtfRevDTTM        16    /* new in 1.10 */
  583. # define        rtfSmallCaps        17
  584. # define        rtfShadow        18
  585. # define        rtfStrikeThru        19
  586. # define        rtfUnderline        20
  587. # define        rtfDotUnderline        21    /* renamed in 1.10 */
  588. # define        rtfDbUnderline        22
  589. # define        rtfNoUnderline        23
  590. # define        rtfWordUnderline    24    /* renamed in 1.10 */
  591. # define        rtfSuperScript        25
  592. # define        rtfSuperScrShrink    26    /* new in 1.10 */
  593. # define        rtfInvisible        27
  594. # define        rtfForeColor        28
  595. # define        rtfBackColor        29
  596. # define        rtfRTLChar        30    /* new in 1.10 */
  597. # define        rtfLTRChar        31    /* new in 1.10 */
  598. # define        rtfCharStyleNum        32    /* new in 1.10 */
  599. # define        rtfCharCharSet        33    /* new in 1.10 */
  600. # define        rtfLanguage        34
  601. # define        rtfGray            35
  602.  
  603. # define    rtfPictAttr    13
  604. # define        rtfMacQD        0
  605. # define        rtfPMMetafile        1
  606. # define        rtfWinMetafile        2
  607. # define        rtfDevIndBitmap        3
  608. # define        rtfWinBitmap        4
  609. # define        rtfPixelBits        5
  610. # define        rtfBitmapPlanes        6
  611. # define        rtfBitmapWid        7
  612. # define        rtfPicWid        8
  613. # define        rtfPicHt        9
  614. # define        rtfPicGoalWid        10
  615. # define        rtfPicGoalHt        11
  616. # define        rtfPicScaleX        12
  617. # define        rtfPicScaleY        13
  618. # define        rtfPicScaled        14
  619. # define        rtfPicCropTop        15
  620. # define        rtfPicCropBottom    16
  621. # define        rtfPicCropLeft        17
  622. # define        rtfPicCropRight        18
  623. # define        rtfPicMFHasBitmap    19    /* new in 1.10 */
  624. # define        rtfPicMFBitsPerPixel    20    /* new in 1.10 */
  625. # define        rtfPicBinary        21
  626.  
  627. # define    rtfBookmarkAttr    14
  628. # define        rtfBookmarkFirstCol    0
  629. # define        rtfBookmarkLastCol    1
  630.  
  631. # define    rtfNeXTGrAttr    15
  632. # define        rtfNeXTGWidth        0
  633. # define        rtfNeXTGHeight        1
  634.  
  635. # define    rtfFieldAttr    16
  636. # define        rtfFieldDirty        0
  637. # define        rtfFieldEdited        1
  638. # define        rtfFieldLocked        2
  639. # define        rtfFieldPrivate        3
  640. # define        rtfFieldAlt        4    /* new in 1.10 */
  641.  
  642. # define    rtfTOCAttr    17
  643. # define        rtfTOCType        0
  644. # define        rtfTOCLevel        1
  645.  
  646. # define    rtfPosAttr    18
  647. # define        rtfAbsWid        0
  648. # define        rtfAbsHt        1
  649. # define        rtfRPosMargH        2
  650. # define        rtfRPosPageH        3
  651. # define        rtfRPosColH        4
  652. # define        rtfPosX            5
  653. # define        rtfPosNegX        6    /* new in 1.10 */
  654. # define        rtfPosXCenter        7
  655. # define        rtfPosXInside        8
  656. # define        rtfPosXOutSide        9
  657. # define        rtfPosXRight        10
  658. # define        rtfPosXLeft        11
  659. # define        rtfRPosMargV        12
  660. # define        rtfRPosPageV        13
  661. # define        rtfRPosParaV        14
  662. # define        rtfPosY            15
  663. # define        rtfPosNegY        16    /* new in 1.10 */
  664. # define        rtfPosYInline        17
  665. # define        rtfPosYTop        18
  666. # define        rtfPosYCenter        19
  667. # define        rtfPosYBottom        20
  668. # define        rtfNoWrap        21
  669. # define        rtfDistFromTextAll    22    /* renamed in 1.10 */
  670. # define        rtfDistFromTextX    23    /* new in 1.10 */
  671. # define        rtfDistFromTextY    24    /* new in 1.10 */
  672. # define        rtfTextDistY        25
  673. # define        rtfDropCapLines        26    /* new in 1.10 */
  674. # define        rtfDropCapType        27    /* new in 1.10 */
  675.  
  676. # define    rtfObjAttr    19
  677. # define        rtfObjEmb        0
  678. # define        rtfObjLink        1
  679. # define        rtfObjAutoLink        2
  680. # define        rtfObjSubscriber    3
  681. # define        rtfObjPublisher        4    /* new in 1.10 */
  682. # define        rtfObjICEmb        5
  683. # define        rtfObjLinkSelf        6
  684. # define        rtfObjLock        7
  685. # define        rtfObjUpdate        8    /* new in 1.10 */
  686. # define        rtfObjHt        9
  687. # define        rtfObjWid        10
  688. # define        rtfObjSetSize        11
  689. # define        rtfObjAlign        12    /* new in 1.10 */
  690. # define        rtfObjTransposeY    13
  691. # define        rtfObjCropTop        14
  692. # define        rtfObjCropBottom    15
  693. # define        rtfObjCropLeft        16
  694. # define        rtfObjCropRight        17
  695. # define        rtfObjScaleX        18
  696. # define        rtfObjScaleY        19
  697. # define        rtfObjResRTF        20
  698. # define        rtfObjResPict        21
  699. # define        rtfObjResBitmap        22
  700. # define        rtfObjResText        23
  701. # define        rtfObjResMerge        24
  702. # define        rtfObjBookmarkPubObj    25
  703. # define        rtfObjPubAutoUpdate    26
  704.  
  705. # define    rtfFNoteAttr    20            /* new in 1.10 */
  706. # define        rtfFNAlt        0    /* new in 1.10 */
  707.  
  708. # define    rtfKeyCodeAttr    21            /* new in 1.10 */
  709. # define        rtfAltKey        0    /* new in 1.10 */
  710. # define        rtfShiftKey        1    /* new in 1.10 */
  711. # define        rtfControlKey        2    /* new in 1.10 */
  712. # define        rtfFunctionKey        3    /* new in 1.10 */
  713.  
  714. # define    rtfACharAttr    22            /* new in 1.10 */
  715. # define        rtfACBold        0    /* new in 1.10 */
  716. # define        rtfACAllCaps        1    /* new in 1.10 */
  717. # define        rtfACForeColor        2    /* new in 1.10 */
  718. # define        rtfACSubScript        3    /* new in 1.10 */
  719. # define        rtfACExpand        4    /* new in 1.10 */
  720. # define        rtfACFontNum        5    /* new in 1.10 */
  721. # define        rtfACFontSize        6    /* new in 1.10 */
  722. # define        rtfACItalic        7    /* new in 1.10 */
  723. # define        rtfACLanguage        8    /* new in 1.10 */
  724. # define        rtfACOutline        9    /* new in 1.10 */
  725. # define        rtfACSmallCaps        10    /* new in 1.10 */
  726. # define        rtfACShadow        11    /* new in 1.10 */
  727. # define        rtfACStrikeThru        12    /* new in 1.10 */
  728. # define        rtfACUnderline        13    /* new in 1.10 */
  729. # define        rtfACDotUnderline    14    /* new in 1.10 */
  730. # define        rtfACDbUnderline    15    /* new in 1.10 */
  731. # define        rtfACNoUnderline    16    /* new in 1.10 */
  732. # define        rtfACWordUnderline    17    /* new in 1.10 */
  733. # define        rtfACSuperScript    18    /* new in 1.10 */
  734.  
  735. # define    rtfFontAttr    23            /* new in 1.10 */
  736. # define        rtfFontCharSet        0    /* new in 1.10 */
  737. # define        rtfFontPitch        1    /* new in 1.10 */
  738. # define        rtfFontCodePage        2    /* new in 1.10 */
  739. # define        rtfFTypeNil        3    /* new in 1.10 */
  740. # define        rtfFTypeTrueType    4    /* new in 1.10 */
  741.  
  742. # define    rtfFileAttr    24            /* new in 1.10 */
  743. # define        rtfFileNum        0    /* new in 1.10 */
  744. # define        rtfFileRelPath        1    /* new in 1.10 */
  745. # define        rtfFileOSNum        2    /* new in 1.10 */
  746.  
  747. # define    rtfFileSource    25            /* new in 1.10 */
  748. # define        rtfSrcMacintosh        0    /* new in 1.10 */
  749. # define        rtfSrcDOS        1    /* new in 1.10 */
  750. # define        rtfSrcNTFS        2    /* new in 1.10 */
  751. # define        rtfSrcHPFS        3    /* new in 1.10 */
  752. # define        rtfSrcNetwork        4    /* new in 1.10 */
  753.  
  754. /*
  755.  * Drawing attributes
  756.  */
  757.  
  758. # define    rtfDrawAttr    26            /* new in 1.10 */
  759. # define        rtfDrawLock        0    /* new in 1.10 */
  760. # define        rtfDrawPageRelX        1    /* new in 1.10 */
  761. # define        rtfDrawColumnRelX    2    /* new in 1.10 */
  762. # define        rtfDrawMarginRelX    3    /* new in 1.10 */
  763. # define        rtfDrawPageRelY        4    /* new in 1.10 */
  764. # define        rtfDrawColumnRelY    5    /* new in 1.10 */
  765. # define        rtfDrawMarginRelY    6    /* new in 1.10 */
  766. # define        rtfDrawHeight        7    /* new in 1.10 */
  767.  
  768. # define        rtfDrawBeginGroup    8    /* new in 1.10 */
  769. # define        rtfDrawGroupCount    9    /* new in 1.10 */
  770. # define        rtfDrawEndGroup        10    /* new in 1.10 */
  771. # define        rtfDrawArc        11    /* new in 1.10 */
  772. # define        rtfDrawCallout        12    /* new in 1.10 */
  773. # define        rtfDrawEllipse        13    /* new in 1.10 */
  774. # define        rtfDrawLine        14    /* new in 1.10 */
  775. # define        rtfDrawPolygon        15    /* new in 1.10 */
  776. # define        rtfDrawPolyLine        16    /* new in 1.10 */
  777. # define        rtfDrawRect        17    /* new in 1.10 */
  778. # define        rtfDrawTextBox        18    /* new in 1.10 */
  779.  
  780. # define        rtfDrawOffsetX        19    /* new in 1.10 */
  781. # define        rtfDrawSizeX        20    /* new in 1.10 */
  782. # define        rtfDrawOffsetY        21    /* new in 1.10 */
  783. # define        rtfDrawSizeY        22    /* new in 1.10 */
  784.  
  785. # define        rtfCOAngle        23    /* new in 1.10 */
  786. # define        rtfCOAccentBar        24    /* new in 1.10 */
  787. # define        rtfCOBestFit        25    /* new in 1.10 */
  788. # define        rtfCOBorder        26    /* new in 1.10 */
  789. # define        rtfCOAttachAbsDist    27    /* new in 1.10 */
  790. # define        rtfCOAttachBottom    28    /* new in 1.10 */
  791. # define        rtfCOAttachCenter    29    /* new in 1.10 */
  792. # define        rtfCOAttachTop        30    /* new in 1.10 */
  793. # define        rtfCOLength        31    /* new in 1.10 */
  794. # define        rtfCONegXQuadrant    32    /* new in 1.10 */
  795. # define        rtfCONegYQuadrant    33    /* new in 1.10 */
  796. # define        rtfCOOffset        34    /* new in 1.10 */
  797. # define        rtfCOAttachSmart    35    /* new in 1.10 */
  798. # define        rtfCODoubleLine        36    /* new in 1.10 */
  799. # define        rtfCORightAngle        37    /* new in 1.10 */
  800. # define        rtfCOSingleLine        38    /* new in 1.10 */
  801. # define        rtfCOTripleLine        39    /* new in 1.10 */
  802.  
  803. # define        rtfDrawTextBoxMargin    40    /* new in 1.10 */
  804. # define        rtfDrawTextBoxText    41    /* new in 1.10 */
  805. # define        rtfDrawRoundRect    42    /* new in 1.10 */
  806.  
  807. # define        rtfDrawPointX        43    /* new in 1.10 */
  808. # define        rtfDrawPointY        44    /* new in 1.10 */
  809. # define        rtfDrawPolyCount    45    /* new in 1.10 */
  810.  
  811. # define        rtfDrawArcFlipX        46    /* new in 1.10 */
  812. # define        rtfDrawArcFlipY        47    /* new in 1.10 */
  813.  
  814. # define        rtfDrawLineBlue        48    /* new in 1.10 */
  815. # define        rtfDrawLineGreen    49    /* new in 1.10 */
  816. # define        rtfDrawLineRed        50    /* new in 1.10 */
  817. # define        rtfDrawLinePalette    51    /* new in 1.10 */
  818. # define        rtfDrawLineDashDot    52    /* new in 1.10 */
  819. # define        rtfDrawLineDashDotDot    53    /* new in 1.10 */
  820. # define        rtfDrawLineDash        54    /* new in 1.10 */
  821. # define        rtfDrawLineDot        55    /* new in 1.10 */
  822. # define        rtfDrawLineGray        56    /* new in 1.10 */
  823. # define        rtfDrawLineHollow    57    /* new in 1.10 */
  824. # define        rtfDrawLineSolid    58    /* new in 1.10 */
  825. # define        rtfDrawLineWidth    59    /* new in 1.10 */
  826.  
  827. # define        rtfDrawHollowEndArrow    60    /* new in 1.10 */
  828. # define        rtfDrawEndArrowLength    61    /* new in 1.10 */
  829. # define        rtfDrawSolidEndArrow    62    /* new in 1.10 */
  830. # define        rtfDrawEndArrowWidth    63    /* new in 1.10 */
  831. # define        rtfDrawHollowStartArrow    64    /* new in 1.10 */
  832. # define        rtfDrawStartArrowLength    65    /* new in 1.10 */
  833. # define        rtfDrawSolidStartArrow    66    /* new in 1.10 */
  834. # define        rtfDrawStartArrowWidth    67    /* new in 1.10 */
  835.  
  836. # define        rtfDrawBgFillBlue    68    /* new in 1.10 */
  837. # define        rtfDrawBgFillGreen    69    /* new in 1.10 */
  838. # define        rtfDrawBgFillRed    70    /* new in 1.10 */
  839. # define        rtfDrawBgFillPalette    71    /* new in 1.10 */
  840. # define        rtfDrawBgFillGray    72    /* new in 1.10 */
  841. # define        rtfDrawFgFillBlue    73    /* new in 1.10 */
  842. # define        rtfDrawFgFillGreen    74    /* new in 1.10 */
  843. # define        rtfDrawFgFillRed    75    /* new in 1.10 */
  844. # define        rtfDrawFgFillPalette    76    /* new in 1.10 */
  845. # define        rtfDrawFgFillGray    77    /* new in 1.10 */
  846. # define        rtfDrawFillPatIndex    78    /* new in 1.10 */
  847.  
  848. # define        rtfDrawShadow        79    /* new in 1.10 */
  849. # define        rtfDrawShadowXOffset    80    /* new in 1.10 */
  850. # define        rtfDrawShadowYOffset    81    /* new in 1.10 */
  851.  
  852. /*
  853.  * index entry attributes
  854.  */
  855.  
  856. # define    rtfIndexAttr    27            /* new in 1.10 */
  857. # define        rtfIndexNumber        0    /* new in 1.10 */
  858. # define        rtfIndexBold        1    /* reclassified in 1.10 */
  859. # define        rtfIndexItalic        2    /* reclassified in 1.10 */
  860.  
  861.  
  862. /*
  863.  * \wmetafile argument values
  864.  */
  865.  
  866. # define    rtfWmMmText        1
  867. # define    rtfWmMmLometric        2
  868. # define    rtfWmMmHimetric        3
  869. # define    rtfWmMmLoenglish    4
  870. # define    rtfWmMmHienglish    5
  871. # define    rtfWmMmTwips        6
  872. # define    rtfWmMmIsotropic    7
  873. # define    rtfWmMmAnisotropic    8
  874.  
  875. /*
  876.  * \pmmetafile argument values
  877.  */
  878.  
  879. # define    rtfPmPuArbitrary    4
  880. # define    rtfPmPuPels        8
  881. # define    rtfPmPuLometric        12
  882. # define    rtfPmPuHimetric        16
  883. # define    rtfPmPuLoenglish    20
  884. # define    rtfPmPuHienglish    24
  885. # define    rtfPmPuTwips        28
  886.  
  887. /*
  888.  * \lang argument values
  889.  */
  890.  
  891. # define    rtfLangNoLang            0x0400
  892. # define    rtfLangAlbanian            0x041c
  893. # define    rtfLangArabic            0x0401
  894. # define    rtfLangBahasa            0x0421
  895. # define    rtfLangBelgianDutch        0x0813
  896. # define    rtfLangBelgianFrench        0x080c
  897. # define    rtfLangBrazilianPortuguese    0x0416
  898. # define    rtfLangBulgarian        0x0402
  899. # define    rtfLangCatalan            0x0403
  900. # define    rtfLangLatinCroatoSerbian    0x041a
  901. # define    rtfLangCzech            0x0405
  902. # define    rtfLangDanish            0x0406
  903. # define    rtfLangDutch            0x0413
  904. # define    rtfLangAustralianEnglish    0x0c09
  905. # define    rtfLangUKEnglish        0x0809
  906. # define    rtfLangUSEnglish        0x0409
  907. # define    rtfLangFinnish            0x040b
  908. # define    rtfLangFrench            0x040c
  909. # define    rtfLangCanadianFrench        0x0c0c
  910. # define    rtfLangGerman            0x0407
  911. # define    rtfLangGreek            0x0408
  912. # define    rtfLangHebrew            0x040d
  913. # define    rtfLangHungarian        0x040e
  914. # define    rtfLangIcelandic        0x040f
  915. # define    rtfLangItalian            0x0410
  916. # define    rtfLangJapanese            0x0411
  917. # define    rtfLangKorean            0x0412
  918. # define    rtfLangBokmalNorwegian        0x0414
  919. # define    rtfLangNynorskNorwegian        0x0814
  920. # define    rtfLangPolish            0x0415
  921. # define    rtfLangPortuguese        0x0816
  922. # define    rtfLangRhaetoRomanic        0x0417
  923. # define    rtfLangRomanian            0x0418
  924. # define    rtfLangRussian            0x0419
  925. # define    rtfLangCyrillicSerboCroatian    0x081a
  926. # define    rtfLangSimplifiedChinese    0x0804
  927. # define    rtfLangSlovak            0x041b
  928. # define    rtfLangCastilianSpanish        0x040a
  929. # define    rtfLangMexicanSpanish        0x080a
  930. # define    rtfLangSwedish            0x041d
  931. # define    rtfLangSwissFrench        0x100c
  932. # define    rtfLangSwissGerman        0x0807
  933. # define    rtfLangSwissItalian        0x0810
  934. # define    rtfLangThai            0x041e
  935. # define    rtfLangTraditionalChinese    0x0404
  936. # define    rtfLangTurkish            0x041f
  937. # define    rtfLangUrdu            0x0420
  938.  
  939. /*
  940.  * CharSet indices
  941.  */
  942.  
  943. # define    rtfCSGeneral    0    /* general (default) charset */
  944. # define    rtfCSSymbol    1    /* symbol charset */
  945.  
  946. /*
  947.  * Flags for auto-charset-processing.  Both are on by default.
  948.  */
  949.  
  950. #if 0
  951.     /* dgg -- don't want this for dclap -- doesn't handle font styles properly */
  952. # define    rtfReadCharSet        0x00    /* auto-read charset files */
  953. # define    rtfSwitchCharSet    0x00    /* auto-switch charset maps */
  954. #else
  955. # define    rtfReadCharSet        0x01    /* auto-read charset files */
  956. # define    rtfSwitchCharSet    0x02    /* auto-switch charset maps */
  957. #endif
  958.  
  959. /*
  960.  * Style types
  961.  */
  962.  
  963. # define    rtfParStyle    0    /* the default */
  964. # define    rtfCharStyle    1
  965. # define    rtfSectStyle    2
  966.  
  967. /*
  968.  * RTF font, color and style structures.  Used for font table,
  969.  * color table, and stylesheet processing.
  970.  */
  971.  
  972. typedef struct RTFFont        RTFFont;
  973. typedef struct RTFColor        RTFColor;
  974. typedef struct RTFStyle        RTFStyle;
  975. typedef struct RTFStyleElt    RTFStyleElt;
  976.  
  977.  
  978. struct RTFFont
  979. {
  980.     char    *rtfFName;        /* font name */
  981.     char    *rtfFAltName;        /* font alternate name */
  982.     short    rtfFNum;        /* font number */
  983.     short    rtfFFamily;        /* font family */
  984.     short    rtfFCharSet;        /* font charset */
  985.     short    rtfFPitch;        /* font pitch */
  986.     short    rtfFType;        /* font type */
  987.     short    rtfFCodePage;        /* font code page */
  988.     RTFFont    *rtfNextFont;        /* next font in list */
  989. };
  990.  
  991.  
  992. /*
  993.  * Color values are -1 if the default color for the the color
  994.  * number should be used.  The default color is writer-dependent.
  995.  */
  996.  
  997. struct RTFColor
  998. {
  999.     short        rtfCNum;    /* color number */
  1000.     short        rtfCRed;    /* red value */
  1001.     short        rtfCGreen;    /* green value */
  1002.     short        rtfCBlue;    /* blue value */
  1003.     RTFColor    *rtfNextColor;    /* next color in list */
  1004. };
  1005.  
  1006.  
  1007. struct RTFStyle
  1008. {
  1009.     char        *rtfSName;    /* style name */
  1010.     short        rtfSType;    /* style type */
  1011.     short        rtfSAdditive;    /* whether or not style is additive */
  1012.     short        rtfSNum;    /* style number */
  1013.     short        rtfSBasedOn;    /* style this one's based on */
  1014.     short        rtfSNextPar;    /* style next paragraph style */
  1015.     RTFStyleElt    *rtfSSEList;    /* list of style words */
  1016.     short        rtfExpanding;    /* non-zero = being expanded */
  1017.     RTFStyle    *rtfNextStyle;    /* next style in style list */
  1018. };
  1019.  
  1020.  
  1021. struct RTFStyleElt
  1022. {
  1023.     short        rtfSEClass;    /* token class */
  1024.     short        rtfSEMajor;    /* token major number */
  1025.     short        rtfSEMinor;    /* token minor number */
  1026.     short        rtfSEParam;    /* control symbol parameter */
  1027.     char        *rtfSEText;    /* text of symbol */
  1028.     RTFStyleElt    *rtfNextSE;    /* next element in style */
  1029. };
  1030.  
  1031.  
  1032. typedef    void (*RTFFuncPtr) ();        /* generic function pointer */
  1033. typedef    void (*RTFFuncCharPtr) (char *);        /* generic function pointer */
  1034.  
  1035.  
  1036. /*
  1037.  * Public RTF reader routines
  1038.  */
  1039.  
  1040. void        RTFInit ();
  1041. void RTFSetStream (FILE* stream);
  1042.  
  1043. void        RTFSetInputName ();
  1044. char        *RTFGetInputName ();
  1045. void        RTFSetOutputName ();
  1046. char        *RTFGetOutputName ();
  1047. void     RTFSetClassCallback (short , RTFFuncPtr callback);
  1048.  
  1049. RTFFuncPtr    RTFGetClassCallback (short aclass);
  1050. void    RTFSetDestinationCallback (short dest,RTFFuncPtr callback);
  1051.  
  1052. RTFFuncPtr    RTFGetDestinationCallback (short dest);
  1053. void        RTFRead ();
  1054. short        RTFGetToken ();    /* writer should rarely need this */
  1055. void        RTFUngetToken ();
  1056. short        RTFPeekToken ();
  1057. void RTFSetToken (short aclass,short major,short minor,short param,char* text);
  1058.  
  1059. void    RTFSetReadHook (RTFFuncPtr f);
  1060.  
  1061. RTFFuncPtr    RTFGetReadHook ();
  1062. void        RTFRouteToken ();
  1063. void        RTFSkipGroup ();
  1064. void    RTFExpandStyle (short n);
  1065.  
  1066. short    RTFCheckCM (short aclass, short major);
  1067. short    RTFCheckCMM (short aclass, short major, short minor);
  1068. short    RTFCheckMM (short major,short minor);
  1069.  
  1070. RTFFont *    RTFGetFont (short num);
  1071.  
  1072. RTFColor * RTFGetColor (short num);
  1073.  
  1074. RTFStyle    *RTFGetStyle (short num);
  1075. # define    RTFAlloc(size)    _RTFAlloc ((short) size)
  1076. char * _RTFAlloc (short size);
  1077.  
  1078. char *    RTFStrSave (char    *s);
  1079.  
  1080. void    RTFFree (char* p);
  1081.  
  1082. short RTFCharToHex (char c);
  1083.  
  1084. short        RTFHexToChar (short i);
  1085. void        RTFSetMsgProc (RTFFuncCharPtr proc);
  1086. void        RTFSetPanicProc (RTFFuncCharPtr proc);
  1087.  
  1088. /*
  1089.  * The following messing around is used to allow RTFMsg() and RTFPanic()
  1090.  * to be variable-argument functions that are declared publicly but
  1091.  * without generating prototype-mismatch errors on systems that have
  1092.  * stdarg.h.
  1093.  */
  1094.  
  1095. #ifndef rtfInternal
  1096. void        RTFMsg ();
  1097. /* void        RTFPanic (); */
  1098. void  RTFPanic (char *fmt, ...);
  1099.  
  1100. #else
  1101. #ifdef STDARG
  1102. void    RTFMsg (char *fmt, ...);
  1103. void    RTFPanic (char *fmt, ...);
  1104. #else
  1105. void        RTFMsg ();
  1106. /* void        RTFPanic (); */
  1107. void RTFPanic (va_dcl);
  1108.  
  1109. #endif    /* STDARG */
  1110. #endif /* rtfInternal */
  1111.  
  1112. short        RTFReadCharSetMap (char* file,short csId);
  1113.  
  1114. void    RTFSetCharSetMap (char* name, short csId);
  1115.  
  1116. short        RTFStdCharCode (char    *name);
  1117. char *RTFStdCharName (short code);
  1118.  
  1119. short    RTFMapChar (short c);
  1120.  
  1121. short        RTFGetCharSet();
  1122. void    RTFSetCharSet (short csId);
  1123.  
  1124. /*char        *RTFGetLibPrefix();*/
  1125. /*void    RTFSetOpenLibFileProc ();*/
  1126.  
  1127. typedef FILE * (*LibFileOpen) (char* file, char* mode);
  1128.  
  1129. void RTFSetOpenLibFileProc (LibFileOpen proc);
  1130.  
  1131. short RTFReadOutputMap (char* file, char* outMap[], short reinit);
  1132.  
  1133. FILE * RTFOpenLibFile (char    *file,char    * mode);
  1134.  
  1135. #ifdef __cplusplus
  1136. }
  1137. #endif
  1138.  
  1139. #endif
  1140.  
  1141. /* The following defines are automatically generated.  Do not edit. */
  1142.  
  1143. #include "rtfchars.h"
  1144.